package com.example.javabasic.thread.classone.demo4;

/**
 * 死锁测试
 */
public class DeadLockTest {

    public static void main(String[] args) {
        //创建两个对象
        DeadLock deadLock = new DeadLock();
        OtherService service = new OtherService(deadLock);
        deadLock.setOtherService(service);

        new Thread(()->{
            while(true){
                deadLock.m1();
            }
        }).start();

        new Thread(()->{
            while (true){
                service.s2();
            }
        }).start();

    }

}
